<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2021/11/12
  Time: 22:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
   pageContext.setAttribute("APP_PATH", request.getContextPath());
%>
<nav class="navbar navbar-default navbar-fixed-top red">
   <div class="container">
      <div class="navbar-header">
         <a class="navbar-brand" href="#">
            <img class="nav-icon img-circle" src="${APP_PATH}/static/img/rainbow.png" alt=""/>
            <span>Rainbow</span>
         </a>
      </div>
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
         <ul class="nav navbar-nav">
            <li><a href="${APP_PATH}/index.jsp">主页</a></li>
            <%--@elvariable id="user" type="com.red.entity.User"--%>
            <c:if test="${!(empty user)}">
            </c:if>
            <c:if test="${user.uLevel == 3}">
               <li><a href="${APP_PATH}/jsp/manage/user_manage.jsp">管理</a></li>
            </c:if>
         </ul>
         <ul class="nav navbar-nav navbar-right">
            <c:if test="${empty user}">
               <li><a href="#" data-target="#myModal" data-toggle="modal">登录</a></li>
            </c:if>
            <c:if test="${!(empty user)}">
               <li>
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                     <c:choose>
                        <c:when test="${user.uLevel == 0}">
                           <span class="label label-primary">普通租客</span>
                        </c:when>
                        <c:when test="${user.uLevel == 1}">
                           <span class="label label-success">会员</span>
                        </c:when>
                        <c:when test="${user.uLevel == 2}">
                           <span class="label label-info">贵宾</span>
                        </c:when>
                        <c:when test="${user.uLevel == 3}">
                           <span class="label label-default">管理员</span>
                        </c:when>
                        <c:otherwise>
                           <span class="label label-default">意料之外的用户类型</span>
                        </c:otherwise>
                     </c:choose>
                     <c:out value="${user.uName}"/>
                     <span class="caret"></span>
                  </a>
                  <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                     <li><a href="${APP_PATH}/queryOrder" target="">我的订单</a></li>
                     <li><a href="${APP_PATH}/exit">退出</a></li>
                  </ul>
               </li>
            </c:if>
            <li><a href="https://gitee.com/rainbow-lab/red">Gitee</a></li>
         </ul>
      </div>
   </div>
</nav>